 // 引入SDK核心类，js文件根据自己业务，位置可自行放置
 var app = getApp()
 var QQMapWX = require('../../utils/lib/qqmap-wx-jssdk.min');
 var qqmapsdk;
 Page({
   data: {
     keywork: "酒店",
     addressArr: []
   },
   onLoad: function () {
     // 实例化API核心类
     qqmapsdk = new QQMapWX({
       key: app.mapKey
     });
   },
   inputChange(e){
     console.log("e:",e)
    this.setData({
      keywork: e.detail.value
    })
   },
   search() {
     let that = this;
     // 调用接口
     qqmapsdk.search({
       keyword: this.data.keywork,
       success: function (res) {
         console.log("请求结果：", res);
         that.setData({
           addressArr: res.data
         })
       },
       fail: function (res) {
         console.log(res);
       },
       complete: function (res) {
         console.log("complete");
       }
     });
   },
   onShow: function () {
     this.search()
   }
 })